import React, { useEffect, useState } from 'react';
import Home from './pages/home/Home';
import Login from './pages/login/Login';


function App() {

  const [isUserLogin, setIsUserLogin]  = useState(false);
    // 模拟登录操作
    const handleLogin = () => {
      console.log("用户登录成功")
      setIsUserLogin(true);
    };
  
    // 模拟登出操作
    const handleLogout = () => {
      setIsUserLogin(false);
    };
  

  return ( 
    <>
    {
      isUserLogin ? <Home /> : <Login onLogin = {handleLogin}/>
    }
    </>   
  );
}

export default App;
